package cn.gov.pbc.gd.credit.vo.center.query;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Map;

import com.liu.tools.StrUtil;

/**
 * @author liuxingmi
 * @datetime 2017年6月7日 上午9:41:25
 * @desc 用户信用查询请求Vo
 */
public class ReqCCCreditReportVo  implements Serializable{
	//branchquery/dissentInnerQueryActionV2.do?name=������&certtype=0&certno=412822198212021417&vertype=24
	//&dissentid=201706024401240400050_c5d7b54d717ec68e0e466fbc7a7adffb&queryreason=04&chargeNO=G2017060200000105705131
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -4783629785522283322L;

	private String id;
	
	/**
	 * 用户名
	 */
	private String name;
	
	/**
	 * 证件类型
	 */
	private String certtype;
	
	/**
	 * 证件号码
	 */
	private String certno;
	
	/**
	 * 查询版本类型
	 */
	private String vertype;
	
	/**
	 * 异议id
	 */
	private String dissentid;
	
	/**
	 * 查询原因
	 */
	private String queryreason;
	
	/**
	 * 缴费编号
	 */
	private String chargeNO;
	
	private Map<String, String> cookies;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCerttype() {
		return certtype;
	}

	public void setCerttype(String certtype) {
		this.certtype = certtype;
	}

	public String getCertno() {
		return certno;
	}

	public void setCertno(String certno) {
		this.certno = certno;
	}

	public String getVertype() {
		return vertype;
	}

	public void setVertype(String vertype) {
		this.vertype = vertype;
	}

	public String getDissentid() {
		return dissentid;
	}

	public void setDissentid(String dissentid) {
		this.dissentid = dissentid;
	}

	public String getQueryreason() {
		return queryreason;
	}

	public void setQueryreason(String queryreason) {
		this.queryreason = queryreason;
	}

	public String getChargeNO() {
		return chargeNO;
	}

	public void setChargeNO(String chargeNO) {
		this.chargeNO = chargeNO;
	}

	public Map<String, String> getCookies() {
		return cookies;
	}

	public void setCookies(Map<String, String> cookies) {
		this.cookies = cookies;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String toParams(String enc) {
		
		try {

			StringBuilder builder = new StringBuilder();
			builder.append("name=");
			builder.append(URLEncoder.encode(name,"GBK"));
			builder.append("&certtype=");
			builder.append(certtype);
			builder.append("&certno=");
			builder.append(URLEncoder.encode(certno, enc));
			builder.append("&vertype=");
			builder.append(vertype);
			builder.append("&dissentid=");
			builder.append(dissentid);
			builder.append("&queryreason=");
			builder.append(queryreason);
			builder.append("&chargeNO=");
			builder.append(chargeNO);

			return builder.toString().replaceAll("null", "");

		} catch (UnsupportedEncodingException e) {
			
		}
		
		try {
			return ("name=" + URLEncoder.encode(name,"GBK") + "&certtype=" + certtype + "&certno=" + URLEncoder.encode(certno, enc) + "&vertype="
					+ vertype + "&dissentid=" + dissentid + "&queryreason=" + queryreason + "&chargeNO=" + chargeNO
					+ "").replaceAll("null", "");
		} catch (UnsupportedEncodingException e1) {

			return "";
		}

	}
		
	
}
